home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / dbasedt3.zip / DBASEDT3.DOC < prev   
Text File  |  1993-01-04  |  7KB  |  152 lines

  1. DBASEDT3.ARC
  2.  
  3. This ARC file contains a different version of the DBASEDIT program available
  4. on several bulletin boards.  The original version was a .COM file which
  5. got its parameters from a file and could be run as a stand alone program
  6. although its original and primary use was to be RUN from inside a dBASE III
  7. program.  This version is a .BIN file which is meant to be LOADed by dBASE
  8. and called with a parameter.  The ARC file includes some sample files and
  9. a dBASE program to show how it can be used.  It also includes source code
  10. so that an interested reader can see an example of a fairly complex program
  11. written to be used in this way.  I have looked at many examples of .BIN
  12. programs for use with dBASE and none of them showed more than the simplest
  13. of techniques which did not work in this complex situation.  I make no claim
  14. that this is the only or best way to do the job, but this code does work.
  15.  
  16. In the process of getting this program to work, I found out a number of things.
  17. First, the Ashton-Tate manuals have only the most rudimentary information
  18. about LOAD/CALL programs and some of what is there doesn't make a whole lot
  19. of sense.  For one thing, they state that the SS and CS registers must be
  20. restored before doing the FAR RETurn.  Restoring the SS register is easy,
  21. but doing anything to the CS register is difficult to say the least.  It
  22. appears that the setting of some of the flags is also critical and that is
  23. never mentioned.  I did not experiment to see just exactly which registers
  24. and flags must be restored.  Instead, I took the reliable way out and saved
  25. and restored everything.  If you are an assembler programmer and not into
  26. mental masochism, I'd advise you to do the same.
  27.  
  28. Incidentally, the program as it stands can not be used with Clipper, at least
  29. the Fall '86 version.  Clipper passes the segment address of the parameter
  30. data in DX instead of in DS.  DBASEDIT would need to be modified in this area
  31. to work.
  32.  
  33. The approach used in the editor is rather simplistic, at least as far as
  34. inserting and deleting characters is concerned so those operations may be
  35. too slow if you are working with large windows.  That operation involves
  36. moving the entire screen after the character for each character entered or
  37. deleted.  I needed a line wrap feature and this was the easiest way to do
  38. it, particularly in view of the fact that I wanted to keep the code to a
  39. reasonable size and the complexity of the job did not require the use of a
  40. sledge hammer to drive a tack.  It is purely a time/elegance trade off.  If
  41. anyone wants to improve it, be my guest.  Please send me a copy of the source
  42. if you do.
  43.  
  44. The system includes an on-line help facilty on F1 and it describes all the
  45. keys used and their functions.  I'll reproduce that screen here and the text
  46. can also be read in the assembler source.
  47.  
  48.                             AADS Editor Help Screen
  49.   Key                  Function
  50.  F1          Invokes this Help screen.
  51.  F3          Inserts a line at the cursor position.
  52.  F5          Deletes the line at the cursor position.
  53.  F7          Deletes from the cursor to end of text.
  54.  F10         Ends the Editor session and resumes AADS processing.
  55.  Tab         Moves cursor to next tab position. (Tabs are set 8 spaces apart.)
  56.  Home        Moves cursor to beginning of current line.
  57.  End         Moves cursor to end of current line.
  58.  Ctrl/End    Clears text to end of line.
  59.  PgUp        Scrolls the window to the previous page.  Shows first line of 
  60.               text if scroll is at or past top.
  61.  Ctrl/PgUp   Moves to beginning of first window of text.
  62.  PgDn        Scrolls the window to the next full page.  Stops at last line of
  63.               text if scroll is at or past bottom.
  64.  Ctrl/PgDn   Moves to beginning of last window of text.
  65.  Backspace   Deletes the charcter ahead of the cursor and moves all following
  66.               characters forward one space.
  67.  Del         Same as Backspace but deletes character under cursor.
  68.  Ins         Puts Editor in Insert mode.  Operates just like dBASE.
  69.  Cursor Keys Move the cursor through the text without changing it.
  70.  
  71. * NOTE - Undefined keys or keys at their limits will beep.
  72.  
  73. DESCRIPTION:
  74.  
  75. DBASEDIT.BIN is a program to use a window inside a dBASE program to create or
  76. modify a text file.  It is used by LOADing the program under dBASE then
  77. CALLing it with a parameter list.  The parameter list is generated in dBASE
  78. as a concatenated text string.  There are 5 3 byte ASCII strings with the
  79. following parameters, in order:
  80.     first row of the edit window,
  81.     last row of the edit window,
  82.     first column of the edit window,
  83.     last column of the edit window,
  84.     max number of lines for the data.
  85. They are followed by the 12 byte file name (includes extension) and
  86. one character which should be a Y or N and indicates to DBASEDIT
  87. whether data will be input (Y) or just displayed in the window (N).
  88.  
  89. Assemble the source (this version used the Microsoft Macro Assembler
  90. Version 5.0), then LINK and EXE2BIN.
  91.  
  92. Following is a sample segment of dBASE source code to use DBASEDIT:
  93.  
  94. ...Set up code goes here
  95.  
  96. LOAD DBASEDIT
  97. ...
  98. FIRSTROW = 2
  99. FIRSTCOL = 1
  100. LASTROW = 23
  101. LASTCOL = 78
  102. MAXLINES = 44
  103. FILENAM = 'HELPXXXX.TXT'
  104. DOANS = 'Y'
  105. PARM = STR(FIRSTROW,3) + STR(LASTROW,3) + STR(FIRSTCOL,3) + ;
  106. STR(LASTCOL,3) + STR(MAXLINES,3) + FILENAM + DOANS
  107. @ FIRSTROW-1,FIRSTCOL-1 TO LASTROW+1,LASTCOL+1 DOUBLE
  108. IF ISCOLOR()
  109.    SET COLOR TO W+/R
  110. ENDIF
  111. @ FIRSTROW,FIRSTCOL CLEAR TO LASTROW,LASTCOL
  112. @ LASTROW+1,18 SAY '[ Press F1 for Editor Help/ F10 when done. ]'
  113.  
  114. CALL DBASEDIT WITH PARM
  115.  
  116. RELEASE DBASEDIT
  117. .... other processing follows
  118.  
  119. The above code would look for the file HELPXXXX.TXT and move the data from
  120. it to the screen if it is found.  At the end of editting, a file by that
  121. name would be created.  I created the file from a dBASE data base then
  122. restored the original data base by appending from the created file.  It
  123. works well and allows some word processor type editting on a dBASE screen.
  124.  
  125. The DBASEDIT program is placed in the public domain for use by one and all.
  126. The only restriction is that use of the program is entirely at your risk.
  127. I do not accept any responsibility of any kind for any problems or losses
  128. associated with any use of this program.  If you do not accept these terms,
  129. don't use the program.  By using it you agree to these conditions.
  130.  
  131. All programs of any reasonable complexity have bugs which will rise up and
  132. strike the unwary in accordance with Murphy's Law or its corollaries.  This
  133. program is no exception and I make no warranties of any kind as to its
  134. correctness or usability.  It has been in use for some time and there are no
  135. known anomalies.  If you find any, I would appreciate knowing about them.
  136. The above disclaimer does not mean to imply that this program is flaky; it
  137. isn't.  It is there because this is a sue-happy world and I don't want to get
  138. hurt by giving something away.  I hope you find DBASEDIT useful.
  139.  
  140. Bob White       4-28-88
  141. 6643 Bertrand Ave.
  142. Reseda, CA 91335
  143. CompuServe 76266,145
  144.  
  145. Revisions
  146.  
  147. DBASEDT3    5-24-88        A bug showed up in back space which is fixed
  148.                 in this version.  It also changed the back
  149.                 space to be a simple destructive back space
  150.                 when not in Insert mode and to delete the
  151.                 character and space when in Insert mode.
  152.